home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 125 / Computer Shopper CD-ROM Issue 125 (1998-07)(Dennis Publishing).iso / Business / Dazzler / DAZZLER.Z / CHtmlAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-26  |  1.5 KB  |  45 lines

  1. import java.io.DataInputStream;
  2. import java.net.MalformedURLException;
  3. import java.net.URL;
  4.  
  5. public class CHtmlAction extends CDisplayAction {
  6.    protected String m_strTargetFrame = "";
  7.    protected String m_strURL = "";
  8.    protected URL m_URL;
  9.  
  10.    boolean LoadFromFile(DataInputStream var1) {
  11.       this.m_strURL = FileLoad.ReadCString(var1);
  12.       FileLoad.ReadCPlusInt(var1);
  13.       FileLoad.ReadCString(var1);
  14.       if (Globals.CUR_COURSE.m_nFileVersion > 3) {
  15.          this.m_strTargetFrame = FileLoad.ReadCString(var1);
  16.       }
  17.  
  18.       return super.LoadFromFile(var1);
  19.    }
  20.  
  21.    public CHtmlAction() {
  22.       super(56);
  23.       ((CDisplayAction)this).SetZOrder((short)1);
  24.    }
  25.  
  26.    boolean DoAction() {
  27.       try {
  28.          this.m_URL = new URL(this.m_strURL);
  29.       } catch (MalformedURLException var1) {
  30.          System.out.println("Error: HTML action has a bad URL " + this.m_strURL);
  31.          return false;
  32.       }
  33.  
  34.       if (this.m_URL != null) {
  35.          if (this.m_strTargetFrame != null && this.m_strTargetFrame.length() != 0) {
  36.             Globals.thePresView.getAppletContext().showDocument(this.m_URL, this.m_strTargetFrame);
  37.          } else {
  38.             Globals.thePresView.getAppletContext().showDocument(this.m_URL, "_self");
  39.          }
  40.       }
  41.  
  42.       return true;
  43.    }
  44. }
  45.